3.1.13 \(\int \frac {\tan (x)}{a+b \cos (x)} \, dx\) [13]

Optimal. Leaf size=20 \[ -\frac {\log (\cos (x))}{a}+\frac {\log (a+b \cos (x))}{a} \]

[Out]

-ln(cos(x))/a+ln(a+b*cos(x))/a

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {2800, 36, 29, 31} \begin {gather*} \frac {\log (a+b \cos (x))}{a}-\frac {\log (\cos (x))}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[x]/(a + b*Cos[x]),x]

[Out]

-(Log[Cos[x]]/a) + Log[a + b*Cos[x]]/a

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 2800

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int \frac {\tan (x)}{a+b \cos (x)} \, dx &=-\text {Subst}\left (\int \frac {1}{x (a+x)} \, dx,x,b \cos (x)\right )\\ &=-\frac {\text {Subst}\left (\int \frac {1}{x} \, dx,x,b \cos (x)\right )}{a}+\frac {\text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \cos (x)\right )}{a}\\ &=-\frac {\log (\cos (x))}{a}+\frac {\log (a+b \cos (x))}{a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 20, normalized size = 1.00 \begin {gather*} -\frac {\log (\cos (x))}{a}+\frac {\log (a+b \cos (x))}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]/(a + b*Cos[x]),x]

[Out]

-(Log[Cos[x]]/a) + Log[a + b*Cos[x]]/a

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 21, normalized size = 1.05

method result size
derivativedivides \(-\frac {\ln \left (\cos \left (x \right )\right )}{a}+\frac {\ln \left (a +b \cos \left (x \right )\right )}{a}\) \(21\)
default \(-\frac {\ln \left (\cos \left (x \right )\right )}{a}+\frac {\ln \left (a +b \cos \left (x \right )\right )}{a}\) \(21\)
risch \(-\frac {\ln \left ({\mathrm e}^{2 i x}+1\right )}{a}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 a \,{\mathrm e}^{i x}}{b}+1\right )}{a}\) \(38\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)/(a+b*cos(x)),x,method=_RETURNVERBOSE)

[Out]

-ln(cos(x))/a+ln(a+b*cos(x))/a

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 20, normalized size = 1.00 \begin {gather*} \frac {\log \left (b \cos \left (x\right ) + a\right )}{a} - \frac {\log \left (\cos \left (x\right )\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(a+b*cos(x)),x, algorithm="maxima")

[Out]

log(b*cos(x) + a)/a - log(cos(x))/a

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 22, normalized size = 1.10 \begin {gather*} \frac {\log \left (-b \cos \left (x\right ) - a\right ) - \log \left (-\cos \left (x\right )\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(a+b*cos(x)),x, algorithm="fricas")

[Out]

(log(-b*cos(x) - a) - log(-cos(x)))/a

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan {\left (x \right )}}{a + b \cos {\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(a+b*cos(x)),x)

[Out]

Integral(tan(x)/(a + b*cos(x)), x)

________________________________________________________________________________________

Giac [A]
time = 0.48, size = 22, normalized size = 1.10 \begin {gather*} \frac {\log \left ({\left | b \cos \left (x\right ) + a \right |}\right )}{a} - \frac {\log \left ({\left | \cos \left (x\right ) \right |}\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(a+b*cos(x)),x, algorithm="giac")

[Out]

log(abs(b*cos(x) + a))/a - log(abs(cos(x)))/a

________________________________________________________________________________________

Mupad [B]
time = 0.51, size = 48, normalized size = 2.40 \begin {gather*} \frac {\mathrm {atan}\left (\frac {a\,{\sin \left (\frac {x}{2}\right )}^2}{a\,{\cos \left (\frac {x}{2}\right )}^2\,1{}\mathrm {i}+b\,{\cos \left (\frac {x}{2}\right )}^2\,1{}\mathrm {i}-b\,{\sin \left (\frac {x}{2}\right )}^2\,1{}\mathrm {i}}\right )\,2{}\mathrm {i}}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)/(a + b*cos(x)),x)

[Out]

(atan((a*sin(x/2)^2)/(a*cos(x/2)^2*1i + b*cos(x/2)^2*1i - b*sin(x/2)^2*1i))*2i)/a

________________________________________________________________________________________